<template>
  <!-- <el-table-column v-if="!col.children" :label="col.label" :prop="col.prop || ''" :show-overflow-tooltip="!col.els">
    <template #header>
      <slot v-if="col.headerSlot" :name="col.headerSlot" />
      <span v-else>{{ col.label }}</span>
    </template>
<template #default="scope">
      <slot v-if="col.slotFlag" :name="col.prop" :rowData="scope.row" />
      <span v-else>{{ typeof scope.row[col.prop] !== 'number' && !scope.row[col.prop] ? '--' : scope.row[col.prop]
        }}</span>
    </template>
</el-table-column>

<el-table-column v-else :label="col.label">
  <TableColumn v-for="t in col.children" :key="t.prop" :col="t">
    注意：如果是vue2中的话customSlots可以替换为$scopedSlots，而且下面setup中的取值也不需要了
    <template v-for="slot in Object.keys(customSlots)" #[slot]="scope">
        以之前的名字命名插槽，同时把数据原样绑定
        <slot :name="slot" v-bind="scope" />
      </template>
  </TableColumn>
</el-table-column> -->

  <!-- ProTableColumn.vue -->

  <template v-if="column.children && column.children.length > 0">
    <table_head_column v-for="(child, index) in column.children"
      :key="`table_head_column__${child.prop || child.label || index}`" :column="child">
      <template v-for="(_, slot) in $slots" :key="slot" #[slot]="slotScope">
        <slot :name="slot" v-bind="slotScope" />
      </template>
    </table_head_column>
  </template>

</template>

<!-- <script>
import { getCurrentInstance, reactive } from 'vue'
export default {
  // 这里的name为必须的
  name: 'TableColumn',
  props: {
    col: {
      type: Object,
      default: () => { }
    },

  },
  setup() {
    const { proxy } = getCurrentInstance()
    const customSlots = reactive({
      ...proxy.$slots
    })
    return {
      customSlots
    }
  }
}
</script> -->


<script setup lang='ts'>




</script>